/***
 *                    _ooOoo_
 *                   o8888888o
 *                   88" . "88
 *                   (| -_- |)
 *                    O\ = /O
 *                ____/`---'\____
 *              .   ' \\| |// `.
 *               / \\||| : |||// \
 *             / _||||| -:- |||||- \
 *               | | \\\ - /// | |
 *             | \_| ''\---/'' | |
 *              \ .-\__ `-` ___/-. /
 *           ___`. .' /--.--\ `. . __
 *        ."" '< `.___\_<|>_/___.' >'"".
 *       | | : `- \`.;`\ _ /`;.`/ - ` : | |
 *         \ \ `-. \_ __\ /__ _/ .-` / /
 * ======`-.____`-.___\_____/___.-`____.-'======
 *                    `=---='
 *
 * .............................................
 *          佛祖保佑             永无BUG
 *@author wwh
 *@date 2022年07月20日22:27
 */
package com.bm.server.controller;

import com.bm.server.dto.DynamicDto;
import com.bm.server.service.intf.DynamicService;
import com.bm.server.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/dynamic")
@Api(tags = "动态相关接口-谢英凡")
@CrossOrigin
public class DynamicController {
    @Resource
    private DynamicService dynamicService;

    @ApiOperation(value = "发布动态接口")//Swagger 为方法加注释
    @PostMapping("/insertDynamic.do")
    public R insertDynamic(@RequestBody DynamicDto dto){
        return dynamicService.insertDynamic(dto);
    }
    //动态查询接口
    @ApiOperation(value = "查询动态接口")//Swagger 为方法加注释
    @PostMapping("/selectDynamic.do")
    public List<DynamicDto> selectDynamic(@RequestParam int uid){
        return dynamicService.selectDynamic(uid);
    }
}
